from llama_index.core import SimpleDirectoryReader,VectorStoreIndex,Settings,get_response_synthesizer,StorageContext,load_index_from_storage,Document
from llama_index.core.node_parser import SentenceSplitter


documents = SimpleDirectoryReader(input_files=["data/SQL.pdf"]).load_data()
# 创建一个句子分割器
node_parser = SentenceSplitter.from_defaults(chunk_size=8000)
# 从文档中获取节点
nodes = node_parser.get_nodes_from_documents(documents)
print(len(nodes))
print(nodes)
index = VectorStoreIndex(nodes, show_progress=True)
